cmake_minimum_required(VERSION 3.22)
set(MOVEIT_LIB_NAME moveit_robot_model)

add_library(${MOVEIT_LIB_NAME} SHARED
  src/aabb.cpp
  src/fixed_joint_model.cpp
  src/floating_joint_model.cpp
  src/joint_model.cpp
  src/joint_model_group.cpp
  src/link_model.cpp
  src/planar_joint_model.cpp
  src/prismatic_joint_model.cpp
  src/revolute_joint_model.cpp
  src/robot_model.cpp
)
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")
ament_target_dependencies(${MOVEIT_LIB_NAME}
  angles
  moveit_msgs
  Eigen3
  eigen_stl_containers
  geometric_shapes
  urdf
  urdfdom_headers
  srdfdom
  visualization_msgs
)
target_link_libraries(${MOVEIT_LIB_NAME}
  moveit_exceptions
  moveit_kinematics_base
)

if(BUILD_TESTING)
  find_package(ament_cmake_gtest REQUIRED)
  ament_add_gtest(test_robot_model test/test.cpp)
  ament_target_dependencies(test_robot_model
    rclcpp
  )
  target_link_libraries(test_robot_model moveit_test_utils ${MOVEIT_LIB_NAME})
endif()

install(DIRECTORY include/ DESTINATION include)
